import javax.swing.*;
import java.awt.*;

public class PokerCalc {
	JFrame osnFrame = new JFrame("PokerCalc");
	JPanel osnPanel = new JPanel();
	JPanel centralPanel = new JPanel();
	JPanel rightPanel = new JPanel();
	JFormattedTextField topTextPanel = new JFormattedTextField(0);
	JFormattedTextField fieldnum1 = new JFormattedTextField(0);
	JFormattedTextField fieldhm1 = new JFormattedTextField(0);
	JFormattedTextField fieldnum5 = new JFormattedTextField(0);
	JFormattedTextField fieldhm5 = new JFormattedTextField(0);
	JFormattedTextField fieldnum25 = new JFormattedTextField(0);
	JFormattedTextField fieldhm25 = new JFormattedTextField(0);
	JFormattedTextField fieldnum50 = new JFormattedTextField(0);
	JFormattedTextField fieldhm50 = new JFormattedTextField(0);
	JFormattedTextField fieldnum100 = new JFormattedTextField(0);
	JFormattedTextField fieldhm100 = new JFormattedTextField(0);
	JButton button1 = new JButton("=");
	JButton button5 = new JButton("=");
	JButton button25 = new JButton("=");
	JButton button50 = new JButton("=");
	JButton button100 = new JButton("=");
	JButton buttonsumm = new JButton("Summ");
	BorderLayout  bl = new BorderLayout();
	GridLayout gl = new GridLayout(5,2);
	GridLayout glbp = new GridLayout(5,0);
	FlowLayout fl = new FlowLayout();
PokerCalc(){
	
		osnPanel.setLayout(bl);
		topTextPanel.setHorizontalAlignment(JTextField.RIGHT);
		osnPanel.add("North", topTextPanel);
		centralPanel.setLayout(gl);
		centralPanel.add(fieldnum1);
		centralPanel.add(fieldhm1);
		centralPanel.add(fieldnum5);
		centralPanel.add(fieldhm5);
		centralPanel.add(fieldnum25);
		centralPanel.add(fieldhm25);
		centralPanel.add(fieldnum50);
		centralPanel.add(fieldhm50);
		centralPanel.add(fieldnum100);
		centralPanel.add(fieldhm100);
		osnPanel.add("Center", centralPanel);
		rightPanel.setLayout(glbp);
		rightPanel.add(button1);
		rightPanel.add(button5);
		rightPanel.add(button25);
		rightPanel.add(button50);
		rightPanel.add(button100);
		osnPanel.add("East", rightPanel);
		osnPanel.add("South", buttonsumm);
		
		osnFrame.setContentPane(osnPanel);
		osnFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		osnFrame.pack(); 
		osnFrame.setVisible(true);
		PokerCalcEngine pCalcEngine = new PokerCalcEngine(this);
		button1.addActionListener(pCalcEngine);
		button5.addActionListener(pCalcEngine);
		button25.addActionListener(pCalcEngine);
		button50.addActionListener(pCalcEngine);
		button100.addActionListener(pCalcEngine);
		buttonsumm.addActionListener(pCalcEngine);
		topTextPanel.addFocusListener(pCalcEngine);
		fieldnum1.addFocusListener(pCalcEngine);
		fieldnum5.addFocusListener(pCalcEngine);
		fieldnum25.addFocusListener(pCalcEngine);
		fieldnum50.addFocusListener(pCalcEngine);
		fieldnum100.addFocusListener(pCalcEngine);
		fieldhm1.addFocusListener(pCalcEngine);
		fieldhm5.addFocusListener(pCalcEngine);
		fieldhm25.addFocusListener(pCalcEngine);
		fieldhm50.addFocusListener(pCalcEngine);
		fieldhm100.addFocusListener(pCalcEngine);
	}
	
public static void main(String[] args) {
PokerCalc calc = new PokerCalc();
}

}
